﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PICGEN
{
    public partial class frmColor : Form
    {
        ColorDialog colorDialog = new ColorDialog();
        public static string resalt = ""; 
        public frmColor(string oldcolor)
        {
            InitializeComponent();
            this.textBox1.Text = oldcolor;
        }

        private void frmColor_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult dr = colorDialog.ShowDialog();
            if (dr == DialogResult.OK)
            {
              textBox2.Text= ColorTranslator.ToHtml(Color.FromArgb(colorDialog.Color.R, colorDialog.Color.G, colorDialog.Color.B));
              resalt = textBox1.Text + "," + textBox2.Text;
                this.Close();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            resalt = "";
            this.Close();
        }
    }
}
